//{name:"",href:"",target:"",rel:"",title:"",children:[]}
var navigations=[
	{name:"界面组件",children:[
		{name:"框架面板",href:"tabsPage.html",target:"navTab",rel:"",title:"",children:[
			{name:"我的主页",href:"main.html",target:"navTab",rel:"main"},
			{name:"页面一",href:"demo_page1.html",target:"navTab",rel:"page1"},
			{name:"页面二",href:"demo_page2.html",target:"navTab",rel:"page2"},
			{name:"页面三",href:"demo_page3.html",target:"navTab",rel:"page3",children:[
				{name:"页面一",href:"demo_page1.html",target:"navTab",rel:"page1"},
				{name:"页面二选项卡面板",href:"demo_page2.html",target:"navTab",rel:"page2"}
			]},
			{name:"页面四",href:"demo_page4.html",target:"navTab",rel:"page4",title:"页面三（自定义标签名）"}
		]},
		{name:"面板",href:"w_panel.html",target:"navTab",rel:"w_panel"},
		{name:"选项卡面板",href:"w_tabs.html",target:"navTab",rel:"w_tabs"},
		{name:"弹出窗口",href:"w_dialog.html",target:"navTab",rel:"w_dialog"},
		{name:"提示窗口",href:"w_alert.html",target:"navTab",rel:"w_alert"},
		{name:"CSS表格容器",href:"w_list.html",target:"navTab",rel:"w_list"},
		{name:"表格容器",href:"demo_page1.html",target:"navTab",rel:"w_table"},
		{name:"树形菜单",href:"w_tree.html",target:"navTab",rel:"w_tree"}
	]},
	{name:"典型页面",children:[
		{name:"文件上传表单提交示例",href:"demo_upload.html",target:"navTab",rel:"demo_upload"},
		{name:"查询我的客户",href:"demo_page1.html",target:"navTab",rel:"demo_page1"},
		{name:"表单查询页面",href:"demo_page1.html",target:"navTab",rel:"demo_page2"},
		{name:"有文本输入的表单",href:"demo_page5.html",target:"navTab",rel:"demo_page5"},
		{name:"有提示的表单输入页面",href:"#",children:[
			{name:"页面一",href:"#"},
			{name:"页面二",href:"#"}
		]}
	]},
	{name:"流程演示",children:[
		{name:"列表",href:"newPage1.html",target:"dialog",rel:"dlg_page"},
		{name:"列表",href:"newPage1.html",target:"dialog",rel:"dlg_page"},
		{name:"列表",href:"newPage1.html",target:"dialog",rel:"dlg_page"},
		{name:"列表",href:"newPage1.html",target:"dialog",rel:"dlg_page"},
		{name:"列表",href:"newPage1.html",target:"dialog",rel:"dlg_page"},
		{name:"列表",href:"newPage1.html",target:"dialog",rel:"dlg_page"},
		{name:"列表",href:"newPage1.html",target:"dialog",rel:"dlg_page"},
		{name:"列表",href:"newPage1.html",target:"dialog",rel:"dlg_page"}
	]}
]

//清理浏览器内存,只对IE起效，FF不需要
if ($.browser.msie) {
	window.setInterval("CollectGarbage();", 10000);
}

$(document).ready(function(){
	//initNavigation();	
//	bindNavigation("contentData",navigations);
//	bindNavigation("contentPage",navigations[0].children);
//	bindNavigation("contentUser",navigations[1].children);
//	bindNavigation("contentTmp",navigations[2].children);
	
	DWZ.init("config.xml", {
		loginUrl:"loginsub.html", loginTitle:"登录",
		callback:function(){
			initEnv();
			$("#themeList").theme({themeBase:"themes"});
//			$.pdialog.open(DWZ.loginUrl, "login", DWZ.loginTitle, {mask:true,width:400,height:200});
		}
	});
})

//function bindNavigation(ID,children){
//	var ul;
//	if(typeof(ID)=="string"){
//		ul=$("#"+ID);
//		ul.html("");
//	}else{
//		ul=$("<ul></ul>");
//		ul.appendTo(ID);
//	}
//	var tmp=$("#itemTmp");
//	$.each(children||[],function(i,n){
//		var row=tmp.clone().removeAttr("id");
//		var a=row.find("a");
//		a.attr("href",n.href||"#").attr("target",n.target||"_blank").attr("title",n.title||"").attr("rel",n.rel||"").text(n.name);
//		row.appendTo(ul);
//		if(n.r-n.l>1||(n.children&&n.children.length>0)){
//			bindNavigation(row,n.children);
//		}
//	})
//}
//
//function callback(data){
//	alert(1);
//}
//
//function addNavigation(){
//	var url="/management/page/addCategory";//"add_navigation.html"
//	$.pdialog.open(url, "add_navigation", "增加分组",{mask:"true"},function(json){
//		//debugger;
//		alert(json);
//	});
//}